using Godot;
using System.Collections.Generic;
using System;
[GlobalClass]

public partial class BTSequence : BTComposite
{

    // Called every frame. 'delta' is the elapsed time since the previous frame.
    public override void run()
    {
		List<Node> children = new List<Node>(this.GetChildren());
		_index_child_node = 0;
		Run_current_childnode();
		//GD.Print("顺序节点");
		
    }

	public override void On_child_completed(bool result)
	{
		if(_index_child_node>=this.GetChildCount())
		{
			if(result)
			{EmitSignal(SignalName.completed,succeed());return;}
			EmitSignal(SignalName.completed,faile());
			return;
		}
		_index_child_node ++;
		Run_current_childnode();
		return;
		
	}
}
